﻿<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学习会管理系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./static/css/font.css">
    <link rel="stylesheet" href="./static/css/weadmin.css">
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
</head>
<body>
    <!-- 顶部开始 -->
    <div class="container">
        <div class="logo">
            <a href="./index.html">学习会管理系统</a>
        </div>

        <div class="left_open">
            <i title="展开左侧栏" class="iconfont">&#xe699;</i>
        </div>
        <ul class="layui-nav right" lay-filter="">
            <li class="layui-nav-item">
                <a href="javascript:;" id="EmpID"></a>
                <dl class="layui-nav-child">
                    <!-- 二级菜单 -->
                    <!--<dd>
                    <a href="#" onclick="WeAdminShow('个人信息','http://www.baidu.com')">个人信息</a>
                </dd>-->
                    <dd>
                        <a class="loginout" href="login.html">退出</a>
                    </dd>
                </dl>
            </li>
            <!--<li class="layui-nav-item to-index">
            <a href="/">前台首页</a>
        </li>-->
        </ul>
    </div>
        <!-- 顶部结束 -->
        <!-- 中部开始 --> 
        <!-- 左侧菜单开始 -->
        <div class="left-nav">
            <div id="side-nav">
                <ul id="nav"></ul>
            </div>
        </div>
        <!-- <div class="x-slide_left"></div> -->
        <!-- 左侧菜单结束 -->
        <!-- 右侧主体开始 -->
        <div class="page-content">
            <div class="layui-tab tab" lay-filter="wenav_tab" id="WeTabTip" lay-allowclose="true">
                <ul class="layui-tab-title" id="tabName">
                    <li>我的桌面</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <iframe src="./views/welcome.html" frameborder="0" class="weIframe"></iframe>
                    </div>
                </div>
            </div>
        </div>
        <div class="page-content-bg"></div>
        <!-- 右侧主体结束 -->
        <!-- 中部结束 -->
        <!-- 底部开始 -->
        <div class="footer">
            <div class="copyright">Copyright ©2019 郑州爱普锐 All Rights Reserved</div>
        </div>
        <!-- 底部结束 -->
        <script type="text/javascript">
            layui.config({
                base: './static/js/'
            }).use('admin');
            layui.use(['jquery', 'admin'], function () {
                var $ = layui.jquery;
                $("#EmpID").text(JSON.parse(window.localStorage.getItem("authInfo")).UserId);
                //页面加载后，获取菜单信息
                $.ajax({
                    url: ApiUrl + "GetModule",
                    //url: "http://172.16.1.27:8899/api/GetModule",
                    type: 'POST',
                    cache: false,
                    headers: {
                        "userid": JSON.parse(window.localStorage.getItem("authInfo")).UserId,
                        "signtoken": JSON.parse(window.localStorage.getItem("authInfo")).SignToken,
                    },
                    success: function (data) {
                        if (data.StatusCode == 200) {
                            $(data.Data).each(function (index, item) {
                                var htmlmenu = "";
                                if (item.ModParentID == 0) {
                                    htmlmenu += '<li id="menu_' + item.ModID + '">';
                                    htmlmenu += '<a href="javascript:;"><i class="iconfont">&#xe6b8;</i><cite>' + item.ModName + '</cite><i class="iconfont nav_right">&#xe697;</i></a>';
                                    htmlmenu += '<ul class="sub-menu"></ul>'
                                    htmlmenu += "</li>";
                                    $("#nav").append(htmlmenu);
                                }
                                else {
                                    htmlmenu += '<li><a _href="/views' + item.ModUrl + '"><i class="iconfont">&#xe6a7;</i><cite>' + item.ModName + '</cite></a></li>';
                                    $("#menu_" + item.ModParentID + " .sub-menu").append(htmlmenu);
                                }
                            });
                            //        < li class="layui-nav-item" >
                            //            <a href="">控制台<span class="layui-badge">9</span></a>
                            //</li >
                            //            <li class="layui-nav-item">
                            //                <a href="">个人中心<span class="layui-badge-dot"></span></a>
                            //            </li>
                            //            <li class="layui-nav-item" lay-unselect="">
                            //                <a href="javascript:;"><img src="//t.cn/RCzsdCq" class="layui-nav-img">我</a>
                            //                    <dl class="layui-nav-child">
                            //                        <dd><a href="javascript:;">修改信息</a></dd>
                            //                        <dd><a href="javascript:;">安全管理</a></dd>
                            //                        <dd><a href="javascript:;">退了</a></dd>
                            //                </dl>

                            var htmlmenuall = "";
                            $(data.Data).each(function (index, item) {
                                var htmlmenu = "";
                                if (item.ModParentID == 0) {
                                    htmlmenu += '<li id="navtop_' + item.ModID + '" class="layui-nav-item" >';
                                    htmlmenu += '<a href="javascript:;">' + item.ModName + '</a>';

                                    var htmlsub = gethtml(data, item.ModID);
                                    htmlmenu += htmlsub;
                                    htmlmenu += "</li>";
                                    //$("#navtop").append(htmlmenu);
                                    htmlmenuall += htmlmenu;
                                }
                                else {

                                    //htmlmenu += ' <dl class="layui-nav-child"><dd><a href="/views' + item.ModUrl + '">' + item.ModName + '</a></dd></dl>';
                                    //$("#navtop_" + item.ModParentID + " .layui-nav-child").append(htmlmenu);
                                }
                            });
                            $("#navtop").append(htmlmenuall);
                        }
                        else if (data.StatusCode == 403) {
                            top.layer.alert(data.Info + ",请重新登录！", { closeBtn: 0 }, function () {
                                top.location.href = "http://" + top.location.host + "/login.html";
                            })
                        }
                        else {
                            layer.msg(data.Info);
                        }
                    }
                });

                function gethtml(data, pid) {

                    var htmlmenuhead = '<dl class="layui-nav - child">';
                    var htmlmenutail = '</dl>';
                    var htmlmenu = '';
                    for (var i = 0; i < data.Data.length; i++) {
                        if (data.Data[i].ModParentID == pid) {
                            htmlmenu += '<dd><a href="/views' + data.Data[i].ModUrl + '">' + data.Data[i].ModName + '</a></dd>';
                        }
                    }
                    if (htmlmenu != '') htmlmenu = htmlmenuhead + htmlmenu + htmlmenutail;
                    return htmlmenu;
                };


            });
        </script>
</body>
<!--Tab菜单右键弹出菜单-->
<!--<ul class="rightMenu" id="rightMenu">
    <li data-type="fresh">刷新</li>
    <li data-type="current">关闭当前</li>
    <li data-type="other">关闭其它</li>
    <li data-type="all">关闭所有</li>
</ul>-->
</html>